/*********************************************************************************
 *
 *  DMP - Day Must Play_er
 *  Copyright (c) 2011 Dario Mazza (dariomzz@gmail.com)
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3, or (at your option)
 *  any later version.
 *  
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program (see the file COPYING); if not, see
 *  http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
 *
 ********************************************************************************/

#ifndef DMP_MAIN_WINDOW_H
#define DMP_MAIN_WINDOW_H

#include <QMainWindow>
#include <Phonon/AudioOutput>
#include <Phonon/SeekSlider>
#include <Phonon/MediaObject>
#include <Phonon/VolumeSlider>
#include <Phonon/BackendCapabilities>
#include <Phonon/MediaSource>
#include <QList>
#include <taglib/mpegfile.h>
#include "ui_DMPMainWindow.h"

class DMPMainWindow : public QMainWindow,public Ui::DMPMainWindow {
	Q_OBJECT
	public:
		DMPMainWindow(QWidget* parent=0);
	private slots:
		void stateChanged(Phonon::State newState, Phonon::State oldState);
		void tick(qint64 time);
		void sourceChanged(const Phonon::MediaSource &source);
		void metaStateChanged(Phonon::State newState, Phonon::State oldState);
		void aboutToFinish();
    		void about();
	private:
		Phonon::MediaObject *mediaObject;
		Phonon::MediaObject *metaInformationResolver;
		Phonon::AudioOutput *audioOutput;
    		QList<Phonon::MediaSource> sources;
		QAction *playAction;
		QAction *pauseAction;
		QAction *stopAction;
		QAction *nextAction;
		QAction *previousAction;
		QAction *addFilesAction;
		QAction *exitAction;
		QAction *aboutAction;
		QAction *aboutQtAction;
		void setupActions();
		void setupMenus();
		void setupToolbar();
		void addFiles();
		void writeMetadataLabel(TagLib::MPEG::File& audioFile);
};
#endif //~DMP_MAIN_WINDOW_H
